package org.biojava.servlets.dazzle;

import java.io.IOException;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.sql.DataSource;

/**
 * Servlet implementation class for Servlet: HelloServlet
 *
 */
 public class HelloServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   
	public HelloServlet() {
		super();
	}   	
		
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
		{
			try{
				response.getWriter().write("Hello, world!!!");
				
				/*Context env = (Context) new InitialContext().lookup("java:comp/env");
				DataSource dataSource;
				dataSource = (DataSource) env.lookup("jdbc/test");
				if ( dataSource != null){
					System.out.println("got conection!");
				}*/
			}
		 catch (Exception e){
			e.printStackTrace();
			System.err.println("could not initialize dataSource, something is seriously broken.");
		}
	}  	

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}   	  	    
}